<?php
	header("Content-Type: text/html;charset=utf-8");
	include("../_judge.php");
	include("../../function/function.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?= $adminweb_titles ?></title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<script>if (top.location != parent.location||self.location==top.location){top.location.replace('../login/admin.php')}</script>
<script language="javascript" src="../script/jquery-1.7.2.min.js"></script>
<script charset="utf-8" src="../script/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="../../SunbeamEditor/themes/default/default.css" />
<script charset="utf-8" src="../../SunbeamEditor/kindeditor.js"></script>
<script charset="utf-8" src="../../SunbeamEditor/lang/zh_CN.js"></script>
<script language="javascript">
KindEditor.ready(function(K) {
	/////   点击上传图片
	var editor = K.editor({
		allowFileManager : false
	});
	K('#image1').click(function() {
		editor.loadPlugin('image', function() {
			editor.plugin.imageDialog({
				imageUrl : K('#news_pic').val(),
				clickFn : function(url, title, width, height, border, align) {
					K('#news_pic').val(url);
					editor.hideDialog();
				}
			});
		});
	});
});

$(document).ready(function(){
	$("#myform").submit(function(){
		var news_title = $("#news_title").val();
		var news_bigclass = $("#news_bigclass").val();

		if (news_title.replace(/\ /g,"").length<1){
			alert("广告标题不能为空！");
			$("#news_title").focus();
			return false;
		}
		if (news_bigclass.replace(/\ /g,"").length<1){
			alert("请选择广告类别！");
			$("#news_bigclass").focus();
			return false;
		}
	});
});
</script>


</head>

<body>
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td><strong>后台管理</strong>&nbsp;-&nbsp;<span class="hong"><strong>广告添加</strong></span></td>
  </tr>

</table>
<form id="myform" name="myform" method="post" action="newsaddsave.php?action=add">
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#333333">
    <tr>
      <td align="right" bgcolor="#EFEFEF">版本选择：</td>
      <td bgcolor="#EFEFEF">
	 <select name="news_language" id="news_language">
        <?php
			$languageid = $news_language;
			getLanguage_option($languageid);
		?>
      </select>	  </td>
    </tr>
    <tr>
      <td width="80" align="right" bgcolor="#EFEFEF">广告标题：</td>
      <td bgcolor="#EFEFEF"><input name="news_title" type="text" id="news_title" size="50" />
      &nbsp;<span class="hong">*</span></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">广告简述：</td>
      <td bgcolor="#EFEFEF"><textarea name="news_text" cols="70" rows="4" id="news_text"><?=$news_text?></textarea></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">广告类别：</td>
      <td bgcolor="#EFEFEF">
	  <select name="news_bigclass" id="news_bigclass">
		<option value="">==请选择类别==</option>
		<?php
			$bigIDs = 3;
			getSoonClass_option($bigIDs,'',$news_bigclass,3); // 下拉option
		?>
      </select></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">上传图片：</td>
      <td bgcolor="#EFEFEF"><input name="news_pic" type="text" id="news_pic" value="<?=$news_pic?>" size="25" />
        <input name="button" type="button" id="image1" value="选择图片" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">转向地址：</td>
      <td bgcolor="#EFEFEF"><input name="news_tourls" type="text" id="news_tourls" size="50" />
        &nbsp;<span class="hong">添加后将自动跳转到目标页面</span></td>
    </tr>
    <tr>
      <td bgcolor="#EFEFEF">&nbsp;</td>
      <td bgcolor="#EFEFEF"><input type="submit" name="Submit" value="提交保存" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置取消" /></td>
    </tr>
</table>
</form>
</body>
</html>
